const log4js = require('koa-log4');
const logger = log4js.getLogger('routes::staff');
var querystring = require('querystring');
const router = require('koa-router')();
exports = module.exports = router;
const mongodb = require('mongodb');
const ObjectId = mongodb.ObjectId;

const _ = require('lodash');
const util = require(global.prefixPath + '/commons/util');
const site_service = require(global.prefixPath + '/services/site');
const info_service = require(global.prefixPath + '/services/info');
const city_service = require(global.prefixPath + '/services/city');
const ad_service = require(global.prefixPath + '/services/adsense');

router.get('/:city/edit/:id', async (ctx, next) => {
    try {
        let info_id = ctx.params.id;
        let result = await info_service.findById(info_id);
        // console.log(result)
        ctx.state.info = result;
    } catch (err) {
        throw err;
    }
    return await ctx.render('edit/index');
});
